/*
 *  Copyright (C) 2019 刘臣轩
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "opencv2/opencv.hpp"
#include "FightingParam.h"

#define RUNE_BRIGHTNESS 0
#define RUNE_COLOR 1

struct RuneParam : FightingParam {
    /*一些识别之外的常数*/
    double rad;
    double pi2;
    double frame_interval_s ; //帧间隔，单位s
    int test_spd_frame;

    int imgproc_mode;
    int ed_times;

    double predict_time ; //预测时间，单位s
    double arm_r; //旋臂半径，单位px（目前采用实时测量法）


	/*与识别有关的常数*/
    double r_max_ratio;/*R标的长宽最大比例（即超过这个值就认为不是R标）*/
    double r_min_area;/*R标最小面积*/
	double r_max_area;/*R标最大面积*/
	double leaf_min_area; /*扇叶最小面积*/
	double leaf_max_area; /*扇叶最大面积*/
	double leaf_min_ratio; /*扇叶最小比例*/
	double leaf_max_ratio;  /*扇叶最大比例*/
	double armor_min_ratio; /*装甲板最小比例*/
	double armor_max_ratio; /*装甲板最大比例*/
	double armor_min_area;
	double armor_max_area;

    double R2armor_min_dist; /*R标到击打目标的最小距离要求*/
    double R2armor_max_dist; /*R标到击打目标的最大距离要求*/

	int blue_thresh; /*识别蓝色时的阈值*/
    int red_thresh;/*识别红色时的阈值*/
	int blue_color_thresh;
	int red_color_thresh;

    int estimation_1;
    int estimation_2;
    int estimation_3;
    int estimation_4;


    void LoadParam() final;
};

extern RuneParam runeParam;
